<template>
  <div>
    <!-- <button @click="addFn">点击+1</button>
    <button @click="$store.dispatch('decreaseAsync')">点击-1</button> -->
    <button @click="increase()">点击+1</button>
    <button @click="decreaseAsync()">点击-1</button>
    <button @click="changeName()">改变名字</button>
  </div>
</template>
<script>
import { mapMutations, mapActions } from 'vuex'
export default {
  created() {},
  methods: {
    // addFn() {
    //   this.$store.commit("increase", 3);
    // },
    ...mapMutations(['increase']),
    ...mapMutations({ changeName: 'users/changeName' }),
    ...mapActions(['decreaseAsync'])
  }
}
</script>
